﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BuXiaChu.OrderDishes.Model;
using BuXiaChu.OrderDishes.BLL;

namespace BuXiaChu.OrderDishes.Web.ServiceStation.Modules
{
    public partial class OrderDetails : System.Web.UI.UserControl
    {
        public long OrderId
        {
            get;
            set;
        }
        protected OrderInfoModel orderInfo = null;
        protected List<OrderItemModel> orderItemList = null;
        protected Dictionary<int, string> restaurantList = new Dictionary<int, string>();
        protected void Page_Load(object sender, EventArgs e)
        {
            orderInfo = OrderInfoManager.GetByOrderInfoId(OrderId);
            orderItemList = OrderInfoManager.GetOrderItemListBy(OrderId);
            orderItemList.ForEach(
                    item =>
                    {
                        if (!restaurantList.ContainsKey(item.RestaurantId))
                        {
                            restaurantList.Add(item.RestaurantId, item.RestaurantName);
                        }
                    }
                );
        }
    }
}